/**
 * Copyright (c) 2010-2011 Pierre Labatut
 *
 * This file is part of Space-Chronicles project.
 *
 * Space-Chronicles is free software: you can redistribute it and/or modify it
 * under the terms of its license which may be found in the accompanying
 * LICENSE file or <http://code.google.com/p/space-chronicles/>.
 */
package space.app.meshview.state;

import java.awt.event.MouseEvent;
import jinngine.math.Quaternion;

/**
 *
 * @author Pierre
 */
class RotateViewpointState extends AbstractRotateState {

    final Quaternion oldQuat;

    public RotateViewpointState(final MeshCamera camera, final Quaternion light, final MouseEvent e) {
        super(camera, light, e);
        oldQuat = new Quaternion(camera.viewquat);
    }

    void applyTransformation(final Quaternion q1) {
        q1.assignMultiply(oldQuat);
        camera.viewquat.assign(q1);
    }
}
